{% extends "fronted/base.html" %}

{% block main %}
    <div class="box box-primary" style="width: 70%; float: left;">
        <div class="box-header with-border"><h3 class="box-title">讨论列表</h3></div>
        <div class="box-body table-responsive no-padding">
            {% if private.discuss %}
                <table class="table table-hover">
                    <tbody>
                        <tr>
                            <td>#</td>
                            <td>标题</td>
                            <td>发布者</td>
                            <td>时间</td>
                            <td>板块</td>
                        </tr>
                        {% for discuss in private.discuss %}
                            <tr>
                                <td>{{ discuss.id }}</td>
                                <td><a href="{{ url_for("fronted.discuss_show", discuss_id = discuss.id) }}">{{ discuss.title }}</a></td>
                                <td>{{ discuss.user }}</td>
                                <td>{{ discuss.time }}</td>
                                <td>{{ discuss.board }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            {% else %}
                暂无讨论
            {% endif %}
        </div>
        <div class="box-footer clearfix">
              <ul class="pagination pagination-sm no-margin">
                {% if private.last_button_url %}
                    <li><a href="{{ private.last_button_url }}">←上页</a></li>
                {% endif %}
                {% if private.next_button_url %}
                    <li><a href="{{ private.next_button_url }}">下页→</a></li>
                {% endif %}
              </ul>
        </div>
    </div>
    <div class="box box-primary" style="width: 29%; float: right;">
        <div class="box-header with-border"><h3 class="box-title">讨论版</h3></div>
        <div class="box-body table-responsive no-padding">
            <table class="table table-hover">
                <tbody>
                    {% for board in private.boards %}
                        <tr>
                            <td><a href="{{ url_for("fronted.discuss_board", board_name = board, page = 1) }}">{{ board }}</a></td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock%}